﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nancy;

namespace distpm.Attibute
{
    public class CheckTokenAttibute:Attribute
    {
        public NancyContext NancyContent { get; set; }

       public CheckTokenAttibute(NancyContext nancyContext)
        {
            this.NancyContent = nancyContext;
            string token = string.Empty;
            foreach (var variable in NancyContent.Request.Headers)
            {
                if (variable.Key == "auth")
                {
                    token = variable.Value.ToString();
                }
                
            }
            Console.WriteLine(token);
        }
        
    }
}
